<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link type="text/css" rel="stylesheet" href="../../resource/css/reset.css"/>
        <link type="text/css" rel="stylesheet" href="../../resource/css/api_index.css"/>
        <script type="text/javascript" src="../../resource/js/fw/jquery-1.8.3.min.js"></script>
    </head>
    <body>
        <div class="pk-wrap">

            <div class="pk-unit-wrap">
                <div class="pk-unit">
                    <h1 class="clearfix">
                        <span class="pk-color-title">Object .propertyIsEnumerable()</span>
                        <span class="pk-float-right pk-tip">Core > Object > propertyIsEnumerable()</span>
                    </h1>
                </div>
                <div class="pk-unit">
                    <div class="pk-unit-with-style">
                        <div class="pk-unit-tag">Description</div>
                        <pre>    检测某个属性是否在for/in循环中可见。

    for/in语句遍历给定对象的可枚举属性。对象的属性不全是可枚举的：那些由JavaScript代码添加到对象中的属性是可枚举的，但那些内置对象的预定义的属性（如方法）通常不可枚举。propertyIsEnumerable()方法提供了一个区分可枚举与不可枚举属性的方法。不过需要注意，ECMAScript标准规定propertyIsEnumerable()不检查原型链，也就是说，这个方法只适用于对象的本地属性，除此之外，没有可用于测试继承属性的可枚举性的方法。</pre>
                    </div>
                </div>
            </div>

                        <div class="pk-unit-wrap">
                <div class="pk-unit">
                    <h1 class="clearfix">
                        <span class="pk-color-title pk-italic">参数 object.propertyIsEnumerable(propname)</span>
                    </h1>
                </div>
                <div class="pk-unit">
                    <table>
                        <thead>
                            <tr>
                                <th class="pk-w120">参数名</th>
                                <th>描述</th>
                            </tr>
                        </thead>
                        <tbody>
                                                        <tr>
                                <td>propname</td>
                                <td>包含对象的指定属性名的一个字符串。</td>
                            </tr>
                                                    </tbody>
                    </table>
                </div>
            </div>
            
                        <div class="pk-unit-wrap">
                <div class="pk-unit">
                    <h1 class="clearfix">
                        <span class="pk-color-title pk-italic">返回值</span>
                    </h1>
                </div>
                <div class="pk-unit">
                    <div class="pk-unit-with-style">
                        <div class="pk-unit-tag">Description</div>
                        <pre>如果对象有一个名为propname的非继承属性，并且该属性可枚举，则返回true，这意味着这个属性可以通过该对象的for/in循环枚举。</pre>
                    </div>
                </div>
            </div>
            
            
            
                        <div class="pk-unit-wrap">
                <div class="pk-unit">
                    <h1 class="clearfix">
                        <span class="pk-color-title pk-italic">代码示例</span>
                    </h1>
                </div>
                <div class="pk-unit">
                    <div class="pk-unit-with-style pk-code">
                        <div class="pk-unit-tag">
                            <span>Code</span>
                        </div>
                        <div class="pk-unit-fns">
                            <a href="javascript:" title="Fold or unfold the code" data-rel="fold-btn">-Fold</a>
                            <a href="javascript:" data-rel="copy-code">Copy</a>
                        </div>
                        <pre><span class="pk-code-key">var</span> o = <span class="pk-code-key">new</span> Object(); // Create an object
o.x = 3.14; // Define a property
o.propertyIsEnumerable("x"); // true: property x is local and enumerable
o.propertyIsEnumerable("y"); // false: o doesn't have a property y
o.propertyIsEnumerable("toString"); // false: toString property is inherited
Object.prototype.propertyIsEnumerable("toString"); // false: nonenumerable</pre>
                    </div>
                </div>
            </div>

            <script type="text/javascript" src="../../resource/js/fw/clipboard/ZeroClipboard.min.js"></script>
            <script type="text/javascript" src="../../resource/js/api_index.js"></script>
            <script type="text/javascript">
                if(window.clipboardData){
                    $('a[data-rel="copy-code"]').click(function(){
                        window.clipboardData.setData('text',$(this).parent().next().text());
                        alert("Copy successfully!");
                    });
                }else{
                    clipboard($('a[data-rel="copy-code"]'),"../../resource/js/fw/clipboard/ZeroClipboard.swf");
                }
            </script>
                    </div>
    </body>
</html>
